<%@page import="org.apache.commons.lang.StringUtils"%>
<%@page import="org.apache.commons.lang.time.DateFormatUtils"%>
<%@page import="org.springframework.util.CollectionUtils"%>
<%@page import="java.util.Collection"%>
<%@ include file="../common/common_include.jsp"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	List<TblCheckReport> list = (List<TblCheckReport>)request.getAttribute("list");
	ReportForm form = (ReportForm)request.getAttribute("command");
%>
<div class="main">
	<div class="oaTable">
<table class="tableList">

	<thead>
		<tr>
			<td colspan="16" style="width: 100%;">
				<div class="FormTools">
					<div>工号：
						<input id="userid" type="text" name="userid" class="search" value="<%=StringUtils.isNotBlank(form.getUserid())?form.getUserid():""%>"
							placeholder="请输入员工编号"/>
						<input type="button" class="searchSubmit" onclick="javascript:XF.Check.reportListSearch()" value="搜索"/>
					</div>
					<div>部门：
						<select id="deptList" class="easyui-combobox" name="deptid" style="width:100px;"></select>
					</div>					
					<div>所属公司：
						<select id="siteList" class="easyui-combobox" name="siteid" style="width:100px;"></select>
					</div>
					<div>
						结束日期：
						<input style="width: 100px;" type="text" value="<%=form.getEnddate() %>" name="enddate" onClick="WdatePicker({lang:'zh-cn',dateFmt:'yyyy-MM-dd'})">
					</div>
					<div>
						开始日期：
						<input style="width: 100px;" type="text" value="<%=form.getStartdate() %>" name="startdate" onClick="WdatePicker({lang:'zh-cn',dateFmt:'yyyy-MM-dd'})">
					</div>
				</div>
			</td>
		</tr>
	</thead>

	<tbody>
		<tr id="tableHeader">
			<th style="width: 6%">工号</th>
			<th style="width: 6%">姓名</th>
			<th style="width: 5%">部门</th>
			<th style="width: 5%">所属公司</th>
			<th style="width: 8%">应勤天数</th>
<!-- 			<th style="width: 10%">上班1</th>
			<th style="width: 5%">下班1</th>
			<th style="width: 10%">上班2</th>
			<th style="width: 5%">下班2</th>
			<th style="width: 5%">上班3</th>
			<th style="width: 5%">下班3</th> -->
			<th style="width: 5%">旷工天数</th>
			<th style="width: 5%">请假天数</th>
			<th style="width: 5%">假日天数</th>
			<th style="width: 5%">实勤天数</th>
		</tr>
		<%
			if (list != null && list.size() > 0) {
				for (TblCheckReport report: list) {
		%>
						<tr>
							<td><%=report.getUserid() %></td>
							<td><%=report.getUsername()!=null?report.getUsername():"" %></td>
							<td><%=report.getDeptname()!=null?report.getDeptname():""%></td>
							<td><%=report.getSitename()!=null?report.getSitename():"" %></td>
							<td><%=report.getShouldDays() %></td>
<%-- 							<td><%=report.getfCheckintime()!=null?DateFormatUtils.format(report.getfCheckintime(), "HH:mm"):"" %></td>
							<td><%=report.getfCheckouttime()!=null?DateFormatUtils.format(report.getfCheckouttime(), "HH:mm"):"" %></td>
							<td><%=report.getsCheckintime()!=null?DateFormatUtils.format(report.getsCheckintime(), "HH:mm"):"" %></td>
							<td><%=report.getsCheckouttime()!=null?DateFormatUtils.format(report.getsCheckouttime(), "HH:mm"):"" %></td>
							<td><%=report.gettCheckintime()!=null?DateFormatUtils.format(report.gettCheckintime(), "HH:mm"):"" %></td>
							<td><%=report.gettCheckouttime()!=null?DateFormatUtils.format(report.gettCheckouttime(), "HH:mm"):"" %></td> --%>
							<td><%=report.getOffworknum() %></td>
							<td><%=report.getLeavenum() %></td>
							<td><%=report.getHolidaynum() %></td>
							<td><%=report.getRealDays() %></td>
						</tr>
					<%
				}
			}
		
		%>
		        
        		<tr id="tableFooter">
			<td colspan="16">
				<div class="pagination">
					<monggoTag:pagination href="report_search"
						pageSize="<%=form.getPageSize()%>"
						totalRecord="<%=form.getTotalRecord() %>"
						currentPage="<%=form.getPageNum() %>">
					</monggoTag:pagination>
				</div>
			</td>
		</tr>
	</tbody>
</table>
</div>
</div>
<script>
$('#siteList').combobox({
	url:global.contextPath + '/company/siteList',
	valueField:'siteid',
	textField:'sitename',
});
$('#deptList').combobox({
	url:global.contextPath + '/company/deptList',
	valueField:'dictid',
	textField:'dictname',
});
$('#siteList').combobox('setValue', '<%=form.getSiteid() %>');
$('#deptList').combobox('setValue', '<%=form.getDeptid() %>');
</script>